package com.zz.common.zid

import cats.data.OptionT
import com.zz.ady.idl.IdType
import com.zz.common.service.IdService.Zid
import com.zz.idl.{IdBundle, IdBundleMeta, ReversedIndexMeta}

trait ZidStorage[F[_]] {

  def storeIdBundle(idBundle: IdBundle, idBundleMeta: IdBundleMeta): F[Unit]
  def storeReversedIndex(id: String, idType: IdType, zid: String, reversedIndexMeta: ReversedIndexMeta): F[Unit]
  def queryZidInfo(zid: String): OptionT[F, (IdBundle, IdBundleMeta)]
  def queryZids(id: String, idType: IdType): OptionT[F, (Zid, Seq[Zid], ReversedIndexMeta)]

}
